package com.lagou.mapreduce;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class HomeworkMapper extends Mapper<LongWritable, Text,HomeworkBean, NullWritable> {
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        HomeworkBean bean = new HomeworkBean();
        bean.setId(1);
        String s = value.toString();
        bean.setNum(Integer.parseInt(s));
        context.write(bean,NullWritable.get());
    }
}
